package com.sgb.kjwl.view.ui.adapter.enterprise;

import android.content.Context;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemIpPickSelectBinding;
import com.sgb.kjwl.databinding.ItemIpPickSelectThreeLevelBinding;
import com.sgb.kjwl.model.entity.PickSelectEntity2;
import com.sgb.kjwl.model.entity.TwoLevelEntity;
import com.sgb.kjwl.model.entity.user.AddressEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class ThreeLevelSelectAdapter<D extends PickSelectEntity2> extends BaseRecycleAdapter<D> {

    ItemIpPickSelectThreeLevelBinding binding;
    public static boolean sIsSimple;

    public ThreeLevelSelectAdapter(Context context, List<D> datas) {
        super(context, R.layout.item_ip_pick_select_three_level, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, D ipPickSelectEntity) {
        binding = (ItemIpPickSelectThreeLevelBinding) holder.getmBinding();

        if (sIsSimple){
            binding.nameView.setText(ipPickSelectEntity.getSimpleName());
        } else {
            binding.nameView.setText(ipPickSelectEntity.getName());
        }

//        if (ipPickSelectEntity.getColor() != 0) {
//            binding.rootLayout.setBackgroundResource(ipPickSelectEntity.getColor());
//
//        } else {
//        }
    }


}
